<?php

/**
 * Guildhistory form base class.
 *
 * @method Guildhistory getObject() Returns the current form's model object
 *
 * @package    raidpoints
 * @subpackage form
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseGuildhistoryForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'aaction'        => new sfWidgetFormInputText(),
      'savedate'       => new sfWidgetFormDateTime(),
      'actiondate'     => new sfWidgetFormDateTime(),
      'dt'             => new sfWidgetFormDateTime(),
      'scheduled_date' => new sfWidgetFormDate(),
      'playerid'       => new sfWidgetFormInputText(),
      'raidid'         => new sfWidgetFormInputText(),
      'value'          => new sfWidgetFormInputText(),
      'ttype'          => new sfWidgetFormInputText(),
      'waitlistflag'   => new sfWidgetFormInputCheckbox(),
      'itemid'         => new sfWidgetFormInputText(),
      'zoneid'         => new sfWidgetFormInputText(),
      'reasonid'       => new sfWidgetFormInputText(),
      'comment'        => new sfWidgetFormInputText(),
      'created_by'     => new sfWidgetFormInputText(),
      'updated_by'     => new sfWidgetFormInputText(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'aaction'        => new sfValidatorString(array('max_length' => 1)),
      'savedate'       => new sfValidatorDateTime(),
      'actiondate'     => new sfValidatorDateTime(),
      'dt'             => new sfValidatorDateTime(),
      'scheduled_date' => new sfValidatorDate(array('required' => false)),
      'playerid'       => new sfValidatorInteger(),
      'raidid'         => new sfValidatorInteger(),
      'value'          => new sfValidatorInteger(),
      'ttype'          => new sfValidatorString(array('max_length' => 1)),
      'waitlistflag'   => new sfValidatorBoolean(array('required' => false)),
      'itemid'         => new sfValidatorInteger(array('required' => false)),
      'zoneid'         => new sfValidatorInteger(),
      'reasonid'       => new sfValidatorInteger(),
      'comment'        => new sfValidatorString(array('max_length' => 255)),
      'created_by'     => new sfValidatorInteger(),
      'updated_by'     => new sfValidatorInteger(),
      'created_at'     => new sfValidatorDateTime(),
      'updated_at'     => new sfValidatorDateTime(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'Guildhistory', 'column' => array('aaction', 'savedate', 'actiondate', 'dt', 'playerid', 'raidid')))
    );

    $this->widgetSchema->setNameFormat('guildhistory[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Guildhistory';
  }

}
